home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000057_icon-group-sender_Thu Mar 27 17:16:15 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2S0GEo08046
for icon-group-addresses; Thu, 27 Mar 2003 17:16:14 -0700 (MST)
Message-Id: <200303280016.h2S0GEo08046@baskerville.CS.Arizona.EDU>
From: voice_of_reason@australia.edu (Quiet Voice)
X-Newsgroups: comp.lang.icon
Subject: Re: newbie questions -- ressurected
Date: 27 Mar 2003 14:00:50 -0800
X-Complaints-To: groups-abuse@google.com
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
"Steve Wampler" <swampler@noao.edu> wrote in message news:<pan.2003.03.26.15.06.49.245949@noao.edu>...
>
> Tables are, by definition, unordered, so you can't reorganize
> the table. But if you're writing the keys and values of a table
> out, you probably shouldn't care - the output is really just
> bytes in a file, not an Icon structure. If you want an order
> imposed on the keys and values in a table, you will need to
> place those keys and values into a list [which is what the
> sort function does for you when given a table].
>
> I'm confused by the statement saying 'data' is an external
> file - are you expecting the sort function to reconstruct
> a table from that files contents automatically?
Hi,
Thanks for you reply.
With the assistance of several others who wrote to me directly via
e:mail, I was able to solve this problem.
The correct code is as follows:
every lettercount := !sort(lettercount,2) do
write(outputfile,lettercount[1]," -- ",lettercount[2])
The one problem is that this sorts it in ascending order. Can't recall
if there is a direct function to sort decending...but that's a minor
concern right now.
Again, thank you.